<?php

namespace app\Cli\controller;

use app\article\model\Article;
use think\App;
use think\Controller;
use Elasticsearch\ClientBuilder;
class Es extends Controller
{
    protected $es;

    public function __construct(App $app = null)
    {
        parent::__construct($app);

        $es = ClientBuilder::create()->setHosts(['127.0.01:9200'])->build();
    }

    public function selectOne()
    {
        $params = [
            'index' => 'goods',
            'type' => '_doc',
            'id' => '2'
        ];
        $response = $this->es->get($params);
        print_r($response);

    }



}
